/**
 * Description: 依从记录Api
 *
 * Created by hrx on 2023/9/18
 */
import service, {IResponseArrayDto, IResponseDto} from "@/utils/ajax";
// import ServerController from "@/utils/server-controller";
// import type { IResponseDto } from "@/utils/request";
import type {IBaseQueryDataListParams} from "@/api/index"
import {AxiosResponse} from "axios";
import {type handHygieneRecordDTO} from "@/api/handHygieneRecord";

export interface queryComplianceRecordParams {
  complianceStatus?: number,
  userName?: string,
  deptIdArrayList?: Array<Array<number>>
}

export interface queryComplianceRecordDescParams {
  id: number
}

export interface complianceRecordDTO {
  complianceRecordCode: string,
  complianceStatus: number,
  complianceStatusStr: string,
  complianceTime: string,
  hospitalDeptName: string,
  id: number,
  subUserName: string,
  triggerLocation: string,
  triggerTime: string,
  triggerType: number,
  triggerTypeStr: string,
}

export function getComplianceRecordListApi(data: IBaseQueryDataListParams<queryComplianceRecordParams>): Promise<AxiosResponse<IResponseDto<IResponseArrayDto<complianceRecordDTO>>>> {
  return service({
    url: '/cloud/compliance/record/queryPage',
    method: "post",
    data,
    headers: {
      "showLoading": true
    },
  })
}

export function getComplianceRecordDescListApi(data: queryComplianceRecordDescParams): Promise<AxiosResponse<IResponseDto<IResponseArrayDto<handHygieneRecordDTO>>>> {
  return service({
    url: '/cloud/compliance/record/details/queryPage',
    method: "post",
    data,
    headers: {
      "showLoading": true
    },
  })
}

export function exportDataApi(data: IBaseQueryDataListParams<queryComplianceRecordParams>):  Promise<AxiosResponse<IResponseDto>> {
  return service({
    url: '/cloud/compliance/record/export',
    method: "post",
    data,
    responseType: 'blob',
    headers: {
      "showLoading": true,
      "Content-Type":"application/json"
    },
  })
}